import request from '@/utils/request'

// 查询按角色授权列表
export function listAuthRole(query) {
  return request({
    url: '/am/authRole/list',
    method: 'get',
    params: query
  })
}

// 查询按角色授权详细
export function getAuthRole(id) {
  return request({
    url: '/am/authRole/' + id,
    method: 'get'
  })
}

// 新增按角色授权
export function addAuthRole(data) {
  return request({
    url: '/am/authRole',
    method: 'post',
    data: data
  })
}

// 修改按角色授权
export function updateAuthRole(data) {
  return request({
    url: '/am/authRole',
    method: 'put',
    data: data
  })
}

// 删除按角色授权
export function delAuthRole(id) {
  return request({
    url: '/am/authRole/' + id,
    method: 'delete'
  })
}



// 查看文件夹
export function listAuthRoleFolder(id){
    return request({
        url: '/am/authRole/listAuthFolder/'+id,
        method: 'get',
    })
}


// 给文件夹授权
export function allotRoleFolder(data){
    return request({
        url: '/am/authRole/allotFolder',
        method: 'post',
        data: data
    })
}
